package com.byxm.wlgw.control.admin;

import java.util.List;

import com.byxm.wlgw.bean.SpxhBean;
import com.byxm.wlgw.control.BaseAction;
import com.byxm.wlgw.service.SpxhService;

public class Spxh_glAction  extends BaseAction{
	private static final long serialVersionUID = 1L;
	SpxhService spxhService= new SpxhService();
	
	private String splbfid;
	
	private SpxhBean spxhBean;
	
	private List<SpxhBean> lstSpxh;
	
	private boolean bflag;
	public String list(){
		try {
			lstSpxh=spxhService.getSpxh(Integer.parseInt(splbfid));
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "success_01";
	}
	public String save(){
		try {
			spxhService.saveSpxh(spxhBean);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "success_02";
	}
	public String delete(){
		try {
			if(spxhService.deleteSpxh(spxhBean.getXhid())){
				bflag=true;
			}else{
				bflag=false;
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "json";
	}
	
	
	
	/********setter getter************/
	public String getSplbfid() {
		return splbfid;
	}
	public void setSplbfid(String splbfid) {
		this.splbfid = splbfid;
	}
	public List<SpxhBean> getLstSpxh() {
		return lstSpxh;
	}
	public void setLstSpxh(List<SpxhBean> lstSpxh) {
		this.lstSpxh = lstSpxh;
	}
	public SpxhBean getSpxhBean() {
		return spxhBean;
	}
	public void setSpxhBean(SpxhBean spxhBean) {
		this.spxhBean = spxhBean;
	}
	public boolean isBflag() {
		return bflag;
	}
	public void setBflag(boolean bflag) {
		this.bflag = bflag;
	}
	
	
	
	
	
	
}
